package com.alibaba.mapper;

import com.alibaba.bean.Pk;
import com.alibaba.bean.PkR;
import com.alibaba.bean.RankListData;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface PkInterfaceMapper {

    @Select(value ="select * from rank1 where userId=#{userId}")
    PkR selectRank1(int userId);

    @Select(value ="select * from rank1 where userId=#{userId}")
    PkR selectRank2(int userId);

    @Select(value ="select Id1 from pk where hoursenum=#{hoursenum}")
    int selectId1(int hoursenum);

    @Select(value ="select Id2 from pk where hoursenum=#{hoursenum}")
    int selectId2(int hoursenum);

    @Delete(value = "delete from rank1 where userId=#{id}")
    int deleteRank1(int id);

    @Update(value ="update rank1 set requesttime=requesttime+1 where userId=#{userId}")
    void updatetimes(int userId);

    @Select(value ="select requesttime from rank1 where userId=#{userId}")
    int selecttimes(int userId);
}
